home *** CD-ROM | disk | FTP | other *** search
/ 220 Jogos / 220 jogos.iso / tetris / tetron / SOURCE / TOP10.H < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-14  |  1.5 KB  |  49 lines

  1. //----------------------------------------------------------------------------------------
  2. //----------------------------------------------------------------------------------------
  3. //
  4. //        Filename        :    top10.h
  5. //        Description        :    Header file for top10 class
  6. //        Author            :   Marnich van Rensburg (2002)
  7. //
  8. //----------------------------------------------------------------------------------------
  9. //----------------------------------------------------------------------------------------
  10.  
  11.  
  12. #include <stdio.h>
  13.  
  14. #ifndef TOP10_H
  15. #define TOP10_H
  16.  
  17.  
  18. //----------------------------------------------------------------------------------------
  19. //    Structure for storing highscore details
  20. //----------------------------------------------------------------------------------------
  21. struct HighScore
  22. {
  23.     char Name[25];            // Players Name
  24.     unsigned int Score;        // The player's score
  25.     unsigned int Lines;        // Total Line Count
  26.     unsigned int Level;        // The current level
  27.     
  28. };// HighScore
  29.  
  30. class Top10
  31. {
  32.     public:    
  33.         Top10();
  34.         void Init();
  35.         bool IsNewHighScore(unsigned int Score);
  36.         void SetEntry(char Name[25], unsigned int Score, unsigned int Lines, unsigned int Level);
  37.         HighScore List[10];            // List of top 10 highscores
  38.  
  39.     private:
  40.         HighScore t_Entry;        // temp highscore entry
  41.  
  42.         void Encrypt(const char *TargetFile);
  43.         void Save();            // Writes highscores to file
  44.         bool Load();            // Reads highscores from file
  45.         void Copy(HighScore& Source, HighScore& Dest);    // Makes a copy of a highscore entry
  46.  
  47. };// Top10
  48.  
  49. #endif;